Skip to content

Change signup success condition to response status#609

Merged
mehul-m-prajapati merged 2 commits into
GitMetricsLab:mainfrom
Vinuthnainti:patch-2
May 31, 2026
Merged

Change signup success condition to response status#609
mehul-m-prajapati merged 2 commits into
GitMetricsLab:mainfrom
Vinuthnainti:patch-2

Conversation

@Vinuthnainti
Copy link
Copy Markdown
Contributor

@Vinuthnainti Vinuthnainti commented May 29, 2026

Description

This PR improves signup success handling by replacing response message string comparison with an HTTP status code check.

Changes

Replaced:

if (response.data.message === "User created successfully") {
navigate("/login");
}
with:
if (response.status === 201) {
navigate("/login");
}

The previous implementation depended on an exact backend response message. If the message text changes in the future, successful signup could fail to redirect users to the login page.

Using the HTTP 201 Created status code is more reliable and aligns with REST API conventions.

Testing

  • Verified successful signup redirects users to the login page.
  • Confirmed existing signup functionality continues to work as expected.

Summary by CodeRabbit

  • Bug Fixes
    • Improved signup form reliability by enhancing account creation success detection, ensuring users are consistently redirected after completing registration.

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 29, 2026

Deploy Preview for github-spy failed.

Name Link
🔨 Latest commit b20236e
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a1c0f367c14540007c258ec

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

Warning

Review limit reached

@mehul-m-prajapati, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 36 minutes and 28 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d9eccef3-b78c-4c79-9880-c9a2b1db7b8a

📥 Commits

Reviewing files that changed from the base of the PR and between 203478e and b20236e.

📒 Files selected for processing (1)
  • src/pages/Signup/Signup.tsx
📝 Walkthrough

Walkthrough

The signup form's post-submission success handler now checks the HTTP response status code (201) to decide whether to redirect to login, instead of relying on a specific backend message string for this decision.

Changes

Signup Success Navigation

Layer / File(s) Summary
HTTP status-based success condition
src/pages/Signup/Signup.tsx
handleSubmit gates the redirect to /login on response.status === 201 instead of comparing response.data.message to a hardcoded success string.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

level:intermediate, quality:clean

Poem

A rabbit hops with joy so keen,
Status codes now rule the scene,
No more strings to chase around,
HTTP 201—success is found! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: replacing the signup success condition from a response message comparison to an HTTP status code check.
Description check ✅ Passed The description is mostly complete with clear explanation of changes, rationale, and testing, though it deviates from the template format by omitting related issue reference and type of change checkbox.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Thank you @Vinuthnainti for your contribution. Please make sure your PR follows https://github.com/GitMetricsLab/github_tracker/blob/main/CONTRIBUTING.md#-pull-request-guidelines

@mehul-m-prajapati mehul-m-prajapati merged commit 3cad6a7 into GitMetricsLab:main May 31, 2026
1 of 2 checks passed
@github-actions
Copy link
Copy Markdown

🎉🎉 Thank you for your contribution! Your PR #609 has been merged! 🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants